//import Vue from 'vue'
//import Vuex from 'vuex'

//Vue.use(Vuex)

const state = {
    /**
     * 微信用户信息
     */
    wechat: {},
}

const mutations = {
    /**
     * 初始化用户信息
     * @param {*} state 
     * @param {*} payload 
     */
    initWechat(state, payload) {
        state.wechat.nick = payload.nick;
        state.wechat.avatar = payload.avatar;
        state.wechat.openId = payload.openId;
        state.wechat.picHost = payload.picHost;
    },
}

const getters = {
    wechat(state) {
        return state.wechat
    },
}

export default new Vuex.Store({
    state,
    mutations,
    getters
})